
public class GraphMaster extends GraphingData {

   /**
    * @param args
    */
   public static void main(String[] args) {
      String servArgs[] = {"9101", "9105", "32", "32", ".56"}; // With R=9, flow 1 needs a service ratio >= .5555
      ServerThread serv = new ServerThread(servArgs);
      
      String dest1Args[] = {"9101"};
      DestThread dest1 = new DestThread(dest1Args);
      String dest2Args[] = {"9105"};
      DestThread dest2 = new DestThread(dest2Args);
      
      String source1Args[] = {"127","0","0","1", "9101", "18", "10100", "true"};
      SourceThread source1 = new SourceThread(source1Args);
      String source2Args[] = {"127","0","0","1", "9105", "9", "10100", "true"};
      SourceThread source2 = new SourceThread(source2Args);
      
      serv.start();
      dest1.start();
      dest2.start();
      source1.start();
      source2.start();
      dest1.print();
      dest2.print();
   }
   
   private static class ServerThread extends Thread {
      private String args[];
      
      public ServerThread(String in_args[]) {
         args = in_args;
      }
      
      public void run() {
         try {
            UDPServer.main(args);
         } catch(Exception e) {
            e.printStackTrace();
         }
      }
   }
   
   private static class SourceThread extends Thread {
      private String args[];
      
      public SourceThread(String in_args[]) {
         args = in_args;
      }
      
      public void run() {
         try {
            UDPClient.main(args);
         } catch(Exception e) {
            e.printStackTrace();
         }
      }
   }
   
   private static class DestThread extends Thread {
      private String args[];
      public UDPDestination ud;      
      
      public DestThread(String in_args[]) {
         args = in_args;
      }
      
      public void run() {
         try {
             UDPDestination ud = new UDPDestination(args);
             ud.run();
         } catch(Exception e) {
            e.printStackTrace();
         }
      }
      public void print(){
    	  ud.print();
      }

   }

}
